package com.uwaterloo.interviewme.requsthandler;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;

import com.uwaterloo.interviewme.model.DetailInfo;
import com.uwaterloo.interviewme.model.Interview;

/**
 * The Class MockRequestHandler for testing purpose.
 */
public class MockRequestHandler extends RequestHandler {

	/** The Constant interivews. */
	private static final List<Interview> interivews = new ArrayList<Interview>();

	static {
		Interview i1 = new Interview("1", "Qualcomm Inc.", "SDE", "TC1111",
				new Date().toLocaleString());
		Interview i2 = new Interview("2", "Amazon.com Inc", "SDE", "TC2222",
				new Date().toLocaleString());

		DetailInfo d1 = new DetailInfo("In Person", "Scheduled", "30",
				"Good Good");
		DetailInfo d2 = new DetailInfo("Phone", "Ranked", "30", "OK Ok");

		i1.setDetailInfo(d1);
		i2.setDetailInfo(d2);

		interivews.add(i1);
		interivews.add(i2);
	}

	/* (non-Javadoc)
	 * @see com.uwaterloo.interviewme.requsthandler.RequestHandler#getAllInterview(java.lang.String)
	 */
	@Override
	public Collection<Interview> getAllInterview(String user) {
		return interivews;
	}

	/* (non-Javadoc)
	 * @see com.uwaterloo.interviewme.requsthandler.RequestHandler#getOneInterview(java.lang.String, java.lang.String)
	 */
	@Override
	public DetailInfo getOneInterview(String user, String interviewID) {
		return interivews.get(Integer.parseInt(interviewID)).getDetailInfo();
	}

	/* (non-Javadoc)
	 * @see com.uwaterloo.interviewme.requsthandler.RequestHandler#login(java.lang.String, java.lang.String)
	 */
	@Override
	public boolean login(String user, String pwd) {
			return true;
	}

	/* (non-Javadoc)
	 * @see com.uwaterloo.interviewme.requsthandler.RequestHandler#setSyncInterval(java.lang.String, int)
	 */
	@Override
	public void setSyncInterval(String user, int interval) {
	}

}
